<?php
namespace app\common\model;

use think\Model;

class BisLocation extends BaseModel
{

    public function getNormalLocationByBisId($bisId) {
        $data = [
            'bis_id' => $bisId,
            'status' => 0,
            'is_main'=>1,
        ];
        $result = $this->where($data)
            ->order('id', 'desc')
            ->find();
        return $result;
    }

    public function getNormalLocationsByBisId($bisId) {
        $data = [
            'bis_id' => $bisId,
            'status' => 1,
        ];
        $result = $this->where($data)
            ->order('id', 'desc')
            ->select();
        return $result;
    }




    public function getNormalLocationByBisIdWith($bisId) {
        $data = [
            'bis_id' => $bisId,

        ];
        $result = $this->where($data)
            ->order('id', 'desc')
            ->find();
        return $result;
    }

   public function getNormalLocationsInId($ids){
        $data = [
            'status' => 1,
            'id' =>['in',$ids],

        ];
        $order = [
          'id' => 'desc',
        ];
        $result = $this->where($data)->order($order)->select();
        return $result;
   }
}